<?php

/**
 * Description of Vo
 * @package Core
 * @author superx
 */
class Core_Vo {

    CONST RENDER_NONE = 'NONE';

    protected static $outputFilters = array();

    public static function registerOutputFilter($callable) {
        self::$outputFilters[] = $callable;
    }

    public static function outputFilter($data) {
        foreach (self::$outputFilters as $callable) {
            $data = call_user_func($callable, $data);
        }
        return $data;
    }

    public static function render($data) {
        if ($data === self::RENDER_NONE) {
            return '';
        } else {
            return self::outputFilter($data);
        }
    }
}
